<?php
/**
 * 
 * Ajax tools
 * @author martin sommervold - martin@sommervold.com
 *
 */
namespace TeamPlayers;

class AjaxTools{
	

	/**
	 * echoJson
	 *
	 * Sends the proper HTTP header, encodes the provided $data as JSON and outputs it to the client
	 *
	 * @param		mixed $data
	 * @return		void
	 * @access		public
	 */
	public static function echoJson( $data )
	{
		$json_data = json_encode( $data );
		header( "Content-type: application/json; charset=UTF-8" );
		echo $json_data;
	}
	
	
}
?>